Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[migrate] replace Markdown IME with HTML editor #14

Merged
merged 20 commits into from
Jul 12, 2024
Merged

Conversation

luojiyin1987
Copy link
Contributor

Checklist(清单):

  • Labels
  • Assignees
  • Reviewers

Closes #12

@luojiyin1987
Copy link
Contributor Author

luojiyin1987 commented Jul 7, 2024

报错

ReferenceError: document is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.<anonymous>
file:///home/luo/nodeWork/OSS-toolbox/node_modules/.pnpm/[email protected][email protected]/node_modules/edkit/dist/index.js (1:4386)```

应该是我没处理好

private Core = createRef<HTMLEditor>();

要怎样处理 Core 的值的传递? @TechQuery

components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
@luojiyin1987 luojiyin1987 changed the title use markdown editor use html editor Jul 7, 2024
@luojiyin1987
Copy link
Contributor Author

不知道怎样处理 core 的值。 @TechQuery

@TechQuery
Copy link
Member

TechQuery commented Jul 9, 2024

不知道怎样处理 core 的值。 @TechQuery

不同的组件传参方式不同,新组件已经和 this.core 没关系了。

不要被现有代码影响,你就搞清楚“新组件的值从哪来,又到哪去”就行了。(你可以直接照抄我给你参考的代码)

@luojiyin1987
Copy link
Contributor Author

fixURL 里面的逻辑怎么处理?

core.root.querySelectorAll('img[src], audio[src], video[src]'), 意义是什么?
@TechQuery

components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
@TechQuery
Copy link
Member

fixURL 里面的逻辑怎么处理?

core.root.querySelectorAll('img[src], audio[src], video[src]'), 意义是什么?

它们就是在把编辑框里的路径处理成本网页真正能加载的 URL。

在新编辑器里:

const root = document.querySelector('div[contenteditable]');

@TechQuery TechQuery self-assigned this Jul 10, 2024
@TechQuery TechQuery added the enhancement Some improvements label Jul 10, 2024
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
components/Git/ArticleEditor.tsx Outdated Show resolved Hide resolved
translation/en-US.ts Outdated Show resolved Hide resolved
translation/en-US.ts Outdated Show resolved Hide resolved
translation/en-US.ts Outdated Show resolved Hide resolved
@TechQuery TechQuery changed the title use html editor [migrate] replace Markdown IME with HTML editor Jul 12, 2024
@TechQuery TechQuery merged commit fe685c2 into main Jul 12, 2024
1 check passed
@TechQuery TechQuery deleted the change-markdown-edit branch July 12, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git Pager 替换 Markdown 输入框为 HTML 编辑器
2 participants